package main

import (
	"context"
	"encoding/json"
	"fmt"
	"google.golang.org/grpc/metadata"
	"kop/pb"
	"log"
	"time"
)

func main() {

	conn := conn()
	c2 := pb.NewBuildingAPIServiceClient(conn)

	var ctx, cancel = context.WithTimeout(context.Background(), time.Second*3)
	defer cancel()

	ctx = metadata.NewOutgoingContext(ctx, metadata.New(map[string]string{"token": token}))

	r2, err := c2.Click(ctx, &pb.BuildingClickRequest{BuildingID: 100, Number: 1})

	fmt.Println(err)

	b, _ := json.Marshal(*r2)

	log.Println(string(b))
}
